package Ppackage;

public class Main
{
    public static void main(String[] args)
    {
        // 创建点对象
        Point point1 = new Point(0, 0);
        Point point2 = new Point(6, 7);
        Point point3 = new Point(0, 0);
        Point point4 = new Point(15, 25);

        // 创建矩形对象
        Rectangle rectangle1 = new Rectangle(point1, point2);
        Rectangle rectangle2 = new Rectangle(point3, point4);

        // 计算并打印矩形的周长和面积
        System.out.println("矩形1的周长: " + rectangle1.getPerimeter() + ", 面积: " + rectangle1.getArea());
        System.out.println("矩形2的周长: " + rectangle2.getPerimeter() + ", 面积: " + rectangle2.getArea());
    }
}

